package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    /**
     * 判断当前用户是否是新用户
     * @param openId
     * @return
     */
    @Select("select * from user where openid = #{openId}")
    User userByOpenId(String openId);

    /**
     * 插入用户数据
     * @param user
     */
    void insert(User user);

    /**
     * 通过用户id获取用户信息
     * @param userId
     * @return
     */
    @Select("select * from user where id=#{userId}")
    User getById(Long userId);
}
